package com.swedne.test.demo

import android.app.Activity
import android.os.Bundle
import android.view.View
import android.widget.TextView
import android.widget.Toast
import com.swedne.test.R
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import lastIndex
import str
import timedOperation
import kotlin.system.measureTimeMillis

class DemoActivity :Activity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_demo)
        findViewById<TextView>(R.id.tv).run {
            text=R.string.app_name.str()
            setOnClickListener {
                Toast.makeText(this@DemoActivity, "aaaaaaa", Toast.LENGTH_LONG).show()
            }
        }

        timedOperation(::testDoSomething)

    }


    private fun testDoSomething(){
        Thread.sleep(1000)
    }
}